package com.wdd.libbase.base

import android.content.Context
import android.view.LayoutInflater
import android.widget.BaseAdapter

/**
 *
 * @ProjectName:    OwnTool
 * @Package:        com.wdd.libbase.base
 * @ClassName:      BaseOwnAdapter
 * @Description:     java类作用描述
 * @Author:         王丹丹
 * @CreateDate:     2019/12/21 18:48
 * @UpdateUser:     更新者
 * @UpdateDate:     2019/12/21 18:48
 * @UpdateRemark:   更新说明
 * @Version:        1.0
 */
abstract class OwnBaseAdapter<T>(context: Context, protected var mDatas: List<T>?) : BaseAdapter() {


    protected val layoutInflater: LayoutInflater = LayoutInflater.from(context)
    override fun getCount(): Int {
        if (mDatas == null) return 0
        return mDatas!!.size
    }

    override fun getItem(position: Int): T {
        return mDatas!![position]
    }

    override fun getItemId(position: Int): Long {
        return position.toLong()
    }


}